package com.purdue.edu.psychotron.client.entity;

import java.io.Serializable;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Entity;

import com.purdue.edu.psychotron.shared.UUID;

@SuppressWarnings("serial")
@Entity
public class User {

	public final static String ROLE_ADMINISTRATER= "ADMINISTRATER";
	public final static String ROLE_NORMALGUEST= "NORMALGJUEST";
	public final static String ROLE_INVALID= "INVALIDs";
	
	public final static String STATUS_AVAILABLE = "AVAILABLE";
	public final static String STATUS_UNAVAILABLE = "UNAVAILABLE";
	public final static String STATUS_EMBARGOED = "EMBARGOED";

	@Id
	private String userId;
	private String firstName;
	private String lastName;
	private String login;
	private String password;
	private String additionalInfo;
	private String role;
	private String status;

	public User() {
	}

	public static class Builder {
		private User User = new User();

		public Builder(User User) {
			this.User = User;
		}

		public Builder(String firstName, String lastName, String login, String password) {
			this.User = new User();
			this.User.userId = UUID.randomUUID();
			this.User.firstName = firstName;
			this.User.lastName = lastName;
			this.User.login = login;
			this.User.password = password;
		}
		
		public Builder setFirstName(String firstName) {
			this.User.firstName = firstName;
			return this;
		}
		
		public Builder setLastName(String lastName) {
			this.User.lastName= lastName;
			return this;
		}
		
		public Builder setLogin(String login) {
			this.User.login = login;
			return this;
		}
		
		public Builder setPassword(String password) {
			this.User.password = password;
			return this;
		}
		
		public Builder setAdditionalInfo(String additionalInfo) {
			this.User.additionalInfo = additionalInfo;
			return this;
		}
		
		public Builder setRole(String role) {
			this.User.role = role;
			return this;
		}
		
		public Builder setStatus(String status) {
			this.User.status = status;
			return this;
		}

		public User build() {
			return this.User;
		}
	}
	
	public String getUserId() {
		return userId;
	}
	
	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public String getAdditionalInfo() {
		return additionalInfo;
	}
	
	public String getLogin() {
		return login;
	}

	public String getPassword() {
		return password;
	}
	
	public String getRole() {
		return role;
	}

	public String getStatus() {
		return status;
	}

}